package com.deng.common.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.deng.common.SQLHelper;
import com.deng.common.dao.IJiShuZhiCheng;
import com.deng.common.dao.IShenFen;
import com.deng.common.vo.AdminDepartmentVo;
import com.deng.common.vo.JiShuZhiChengVo;
import com.deng.common.vo.ShenFenVo;

public class JiShuZhiChengImpl extends SQLHelper implements IJiShuZhiCheng {

	public List<JiShuZhiChengVo> getAllData() {
		try{
			Connection conn = getConnect();
			
			String sql = "select * from DICT_JISHUZHICHENG order by name";
			ResultSet rs = queryData(conn,sql);	
			List<JiShuZhiChengVo> list = new ArrayList<JiShuZhiChengVo>();
			while(rs.next()){
				JiShuZhiChengVo vo = new JiShuZhiChengVo();
				vo.id = rs.getInt("id");
				vo.name = rs.getString("name");
				vo.fee = rs.getBigDecimal("fee")!=null?rs.getBigDecimal("fee").toString():null;
				vo.point = rs.getBigDecimal("point")!=null?rs.getBigDecimal("point").toString():null;;
				list.add(vo);
			}
			freeConnection(conn);
			return list;
		}catch(Exception ex){
			ex.printStackTrace();
		}
		return null;
	}

}
